package com.tbb.app.base.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tbb.app.base.entity.Note;
import com.tbb.app.base.vo.SimpleVO;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 笔记表 Mapper 接口
 *
 * @author Liu
 * @since 2022-01-11
 */
public interface NoteMapper extends BaseMapper<Note> {

    @Select("SELECT " +
            " b.`name` AS 'name', " +
            " count(*) AS 'value'  " +
            "FROM " +
            " tbb_note a " +
            " LEFT JOIN tbb_channel b ON a.channel_id = b.id  " +
            "GROUP BY " +
            " a.channel_id")
    List<SimpleVO> noteChannel();

}
